{include file="public/header" /}
    <!--提交您的案件标题部分开始-->
{volist name="ret" id="vo"}
{if condition="$key eq 0"}
    <div class="layui-fluid layui-margin-bottom-100 layui-margin-top-100 wow zoomIn" data-wow-duration='1.2s'>
        <div class="layui-row">
            <div class="layui-col-md12  layui-text-center layui-one">
                <span class="layui-padding layui-boder-b">{$vo.title}</span>
            </div>
        </div>
        <div class="layui-row" style="margin-top: 60px;">
            <div class="layui-col-md12  layui-text-center layui-two">
                <span>{$vo.generalize}</span>
            </div>
        </div>
    </div>
    <!--提交您的案件标题部分结束-->
    <!--提交您的案件内容部分开始-->
    <div class="layui-container layui-margin-bottom-100 wow bounceInRight" data-wow-duration='1.2s'>
        <div class="layui-row">
            <div class="layui-col-md8 layui-col-md-offset2">
                <div class="submitcase-wraper">
                    <div class="submitcase-wraper-title">
                        <h2>你是怎么知道零零诉的？</h2>
                        <div class="submitcase-head-item">
                            <span class="head-item" data-id="1">朋友推荐</span>
                            <span class="head-item" data-id="2">微信</span>
                            <span class="head-item" data-id="3">百度搜索</span>
                            <span class="head-item" data-id="4">短信</span>
                            <span class="head-item" data-id="5">电话销售</span>
                            <span class="head-item" data-id="6">今日头条</span>
                            <span class="head-item" data-id="7">微博</span>
                            <span class="head-item" data-id="8">其他</span>
                        </div>
                    </div>
                    <form action="" class="submitcase-wraper-formgroup" id="from">
                        <div class="submitcase-wraper-item">
                            <label for="plaintiff-name">原告名称</label>
                            <input type="text" name="yname" id="plaintiff-name">
                            <span class="text-color-red">*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label for="defendant-name">被告名称</label>
                            <input type="text" name="bname" id="defendant-name">
                            <span class="text-color-red">*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label for="case-money">涉案金额</label>
                            <input type="text" name="money" id="case-money">
                            <span class="text-color-red">万*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label for="case-type">案件类型</label>
                            <select name="cateid" id="case-type" class="case-type">
                                <option value="" selected>请选择案件类型</option>
                                {volist name="casecate" id="case"}
                                <option value="{$case.id}">{$case.title}</option>
                                {/volist}
                            </select>
                            <span class="text-color-red">*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label for="case-addr">请输入起诉地点</label>
                            <input type="text" name="address" id="case-addr">
                            <span class="text-color-red">*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label for="where-addr">希望找哪里的律师</label>
                            <input type="text" name="hope" id="where-addr">
                            <span class="text-color-red">*</span>
                        </div>
                        <div class="submitcase-wraper-item">
                            <label class="case-explain-label" for="defendant-name">案件简介</label>
                            <textarea name="content" id="case-explain" class="case-explain" cols="70" rows="10"></textarea>
                            <span class="text-color-red">*</span>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label upfile">上传文件</label>
                            <div class="layui-input-block">
                                <div class="line">
                                        <input type="text" name="thumb" placeholder="文件大小不超过5M！" class="layui-input thumb" style="width: 495px">
                                        <button type="button" onclick="GetUploadify(12,'articles');" class="layui-btn">上传文件</button>
                                </div>
                            </div>
                        </div>
                        <div class="submitcase-wraper-item">
                                <label class="atention-type">注意事项</label>
                                <div style="display: inline-block">
                                  <p>推荐上传资料清单</p> 
                                  <p>未诉：相关合同，协议等材料</p> 
                                  <p>一审：起诉状、或者答辩状，提交给法院的证明资料</p> 
                                  <p>二审：一审判决书及上诉状</p> 
                                </div>
                            </div>
                            <button type="submit" class="subimitcase-sub">提交</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
{/if}
{/volist}
    <!--提交您的案件内容部分结束-->

    <!--提交流程标题部分开始-->
{volist name="ret" id="vo"}
{if condition="$key eq 1"}
    <div class="layui-fluid layui-margin-bottom-100 wow zoomIn" data-wow-duration='1.2s'>
        <div class="layui-row">
            <div class="layui-col-md12  layui-text-center layui-one">
                <span class="layui-padding layui-boder-b">{$vo.title}</span>
            </div>
        </div>
        <div class="layui-row" style="margin-top: 60px;">
            <div class="layui-col-md12  layui-text-center layui-two">
                <span>{$vo.generalize}</span>
            </div>
        </div>
    </div>
    <!--提交流程标题部分结束-->
    <!--提交流程内容部分开始-->
    <div class="layui-container layui-margin-bottom-100 wow bounceInRight" data-wow-duration='1.2s'>
        <div class="layui-row">
            <div class="layui-col-md12">
                <ul class="submitcase-process">
                    {volist name="$vo.son" id="vo2"}
                    <li class="submitcase-process-item">
                        <img src="{$vo2.thumb}">
                        <span class="submitcase-process-text">{$vo2.title}</span>
                    </li>
                    {if condition="$key eq $cont-1"}

                    {else /}
                    <img class="submitcase-process-img" src="__STATIC__/computer/img/lls06/lls0609.png">
                    {/if}
                    {/volist}

                </ul>
            </div>
        </div>
    </div>
{/if}
{/volist}
    <!--提交流程内容部分结束-->
    <script>
        layui.use('upload', function () {
            var upload = layui.upload;
            //执行实例
            var uploadInst = upload.render({
                elem: '#case-file', //绑定元素
                url: '/upload/', //上传接口
                done: function (res) {
                    alert('上传成功');
                },
                error: function () {
                    alert('上传失败');
                }
            });
        });
    </script>
    <script>
        //返回路径插入到指定元素
        function upload_callback(url)
        {
            $('input[name=thumb]').val(url);
        }

        //选择    你是怎么知道零零诉的


        //提交form表单
        layui.use(['form'],function () {
            var form = layui.form;
            var aid = '';
            $('.submitcase-head-item .head-item').click(function () {
                $(this).addClass('head-item-active').siblings().removeClass('head-item-active');
                aid = $(this).attr('data-id');
            });

            $("#from").submit(function (e) {
                e.preventDefault();
                if (!aid){
                    layer.msg('请选择推荐来源');
                    return 0;
                }
                var formsize = $.param({'knowid':aid})+'&'+$(this).serialize();
                $.post("{:url('/index/submitcase/add')}",formsize,function (data) {
                       if(data.code == 0){
                           layer.msg(data.msg);
                       }else if(data.code == 2)
                       {
                           layer.msg(data.msg);
                          /* setTimeout(function () {
                               window.location.href="{:url('/index/login/index')}";
                           },2000);      //延迟两秒页面*/

                       }else {
                           layer.msg(data.msg);
                          /*setTimeout(function () {
                               location.reload();
                           },2000);      //延迟两秒刷新页面*/
                       }
                });
            });
            form.render();
        });

    </script>

{include file="public/footer" /}
